import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
class myHeader extends Component {
  focus() {
    console.log(this.props);
    this.props.history.push("/search")
  }
  render() {
    return (
      <div className='header'>
        <input type="text" onFocus={() => { this.focus() }} />
        <span>搜索</span>
      </div>
    );
  }
}

export default withRouter(myHeader);